package com.rf.richfitwheel.common.exception;


import com.rf.richfitwheel.common.enums.ResultStatus;
import com.rf.richfitwheel.common.utils.R;

/**
 * 业务异常类
 *
 * @author RichfitWheel
 */

public class ResultException extends RuntimeException {
    private static final long serialVersionUID = 3489922047981012221L;

    /**
     * 业务异常信息信息
     */
    private ResultStatus resultStatus;
    private R r;

    public ResultException() {
        this(ResultStatus.INTERNAL_SERVER_ERROR);
    }

    public ResultException(ResultStatus resultStatus, String msg) {
        super(msg);
        this.resultStatus = resultStatus;
    }

    public ResultException(ResultStatus resultStatus) {
        super(resultStatus.getMessage());
        this.resultStatus = resultStatus;
    }

    public ResultException(R r) {
        super(r.getMsg());
        this.r = r;
    }

    public ResultStatus getResultStatus() {
        return this.resultStatus;
    }

    public R getR() {
        return this.r;
    }

}
